home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / g_quake / server~1.zip / _MOTD.QC < prev    next >
Text File  |  1996-10-04  |  4KB  |  134 lines

  1. /*
  2. **
  3. ** _motd.qc (Motd Code, 1.1)
  4. **
  5. ** Copyright (C) 1996 Johannes Plass
  6. ** 
  7. ** This program is free software; you can redistribute it and/or modify
  8. ** it under the terms of the GNU General Public License as published by
  9. ** the Free Software Foundation; either version 2 of the License, or
  10. ** (at your option) any later version.
  11. ** 
  12. ** This program is distributed in the hope that it will be useful,
  13. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. ** GNU General Public License for more details.
  16. **
  17. ** You should have received a copy of the GNU General Public License
  18. ** along with this program; if not, write to the Free Software
  19. ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. ** 
  21. ** Author:   Johannes Plass (plass@dipmza.physik.uni-mainz.de)
  22. **
  23. */
  24.  
  25. //==============================================================
  26. //   Defaults
  27. //==============================================================
  28.  
  29. // To modify the MOTD or the duration it is displayed when
  30. // a player connects please consult in the function 'MotdInit'
  31. // below.
  32.  
  33. //==============================================================
  34. //   MotdInfo
  35. //==============================================================
  36.  
  37. void(entity player) MotdInfo =
  38. {
  39.    // nothing to do
  40. };
  41.  
  42. //==============================================================
  43. //   MotdActiveMessage
  44. //==============================================================
  45.  
  46. void(entity player) MotdActiveMessage =
  47. {
  48.   if (!USE_MODULE_MOTD) return;
  49.               // 123456789#123456789#123456789#12345678
  50.   sprint(player,"  Motd\n");
  51. };
  52.  
  53. //==============================================================
  54. //   MotdInit
  55. //==============================================================
  56.  
  57. void(entity player) MotdInit =
  58. {
  59.    if (!USE_MODULE_MOTD) {
  60.       PlayerStatusSetFlag(player,PLAYER_PASSED_MOTD);
  61.       return;
  62.    }   
  63.  
  64.    /*
  65.    ** 'motd_motd' is the message shown when a player first connsects
  66.    **             to the server. Note that it *must* not be longer than 
  67.    **             255 chars !
  68.    ** 'motd_duration' is the time the motd stays center-printed 
  69.    **             on the player's screen (in units of seconds).
  70.    ** By default *no* message is shown.
  71.    */
  72.  
  73.    motd_motd     = "╙σ≥÷σ≥═∩Σ⌡∞σ≤ ▓«╡«╢\n\n¡¡\n\ntype 'help-server' for help\n\n¡¡\n\npress jump to join the game";
  74.  
  75.    motd_duration = 5.0; // time the motd stays center-printed (in units of seconds)
  76.  
  77. /*
  78. === A scratch-board: =====================
  79.    
  80. 123456789#123456789#123456789#12345678
  81.    motd_motd     = "
  82. ╙σ≥÷σ≥═∩Σ⌡∞σ≤ ▓«╡«╢\n\n¡¡\n\n
  83. type 'help-server' for help\n\n¡¡\n\n
  84. press jump to join the game";
  85.  
  86.    ServerModules 1 2 3 4 5 6 7 8 9 0 . -
  87.    ╙σ≥÷σ≥═∩Σ⌡∞σ≤ ▒ ▓ │ ┤ ╡ ╢ ╖ ╕ ╣ ░ « ¡
  88.  
  89. ==========================================
  90. */
  91.  
  92.    player.motd_start_time = time;
  93.    player.motd_centerprint_time = time - 2;
  94.    player.motd_status = player.motd_status | MOTD_MOTD;
  95. };
  96.  
  97. //==============================================================
  98. //   MotdThink
  99. //==============================================================
  100.  
  101. void() MotdThink =
  102. {
  103.    if (self.button2) {
  104.       centerprint(self,"");
  105.       self.motd_status = 0;
  106.       PlayerStatusSetFlag(self,PLAYER_PASSED_MOTD);
  107.    }
  108.  
  109.    if (self.player_status & PLAYER_PASSED_MOTD) return;
  110.  
  111.    if (self.motd_status & MOTD_MOTD) {
  112.       if (time < self.motd_start_time + motd_duration) {
  113.          if (time > self.motd_centerprint_time + 1.8) {
  114.             centerprint(self,motd_motd);
  115.             self.motd_centerprint_time = time;
  116.          }
  117.       } else {
  118.          centerprint(self,"");
  119.          self.motd_status = self.motd_status - MOTD_MOTD;
  120.          self.motd_status = self.motd_status | MOTD_CONSOLE;
  121.       }
  122.       return;
  123.    }
  124.  
  125.    if (self.motd_status & MOTD_CONSOLE) {
  126.       ServerHelpShowHelp(self);//#jp#(ServerHelp)
  127.       ServerHelpAnnounce(self);//#jp#(ServerHelp)
  128.       self.motd_status = self.motd_status - MOTD_CONSOLE;
  129.       PlayerStatusSetFlag(self,PLAYER_PASSED_MOTD);
  130.       return;
  131.    }
  132.  
  133. };
  134.